﻿using System;
using System.ComponentModel;
using System.Drawing;
using Microsoft.WowAddonStudio.FrameXml.Components.Events;
using Microsoft.WowAddonStudio.FrameXml.Serialization;
using Microsoft.WowAddonStudio.FrameXml.Serialization.LayoutFrames;

namespace Microsoft.WowAddonStudio.FrameXml.Components
{
	[ToolboxBitmap(typeof(System.Windows.Forms.WebBrowser), "WebBrowser.bmp")]
	[ToolboxItemFilter("WowAddonStudio", ToolboxItemFilterType.Require)]
    [EventGroup(EventGroup.SimpleHTML, EventName.OnLoad)]
    public class SimpleHTMLControl : FrameControl
    {
		/// <summary>
		/// Initializes a new instance of the <see cref="SimpleHTMLControl"/> class.
		/// </summary>
    	public SimpleHTMLControl()
    	{
    	}

    	/// <summary>
        /// Initializes a new instance of the <see cref="SimpleHTMLControl"/> class.
        /// </summary>
        /// <param name="simpleHTML">The simple HTML.</param>
        public SimpleHTMLControl(SimpleHTML simpleHTML)
            : base(simpleHTML)
        {
        }

        /// <summary>
        /// Gets the SimpleHTML.
        /// </summary>
        /// <value>The SimpleHTML.</value>
        public SimpleHTML Slider
        {
            get { return this.SerializationObject as SimpleHTML; }
        }

        /// <summary>
        /// Gets the type of the serialization object this control manages.
        /// </summary>
        public override Type SerializationObjectType
        {
            get
            {
                return typeof(SimpleHTML);
            }
        }

        /// <summary>
        /// Gets the default size of a FrameXML control.
        /// </summary>
        /// <value></value>
        protected override Size DefaultSize
        {
            get { return new Size(200, 250); }
        }
    }
}
